<%@include file="/WEB-INF/pages/commons/commons.jsp"%>

<jsecurity:lacksPermission name="blog:viewResources:${actionBean.blogEntry.blog.id}">
    No "blog:viewResources:${actionBean.blogEntry.blog.id}" permission  
</jsecurity:lacksPermission>


<jsecurity:hasPermission name="blog:viewResources:${actionBean.blogEntry.blog.id}">
        <stripes:url var="tableUrl" beanclass="foo.bar.blog.web.action.registered.BlogsProfileActionBean" event="resources"/>
        <fmt:message var="col_id" key="view_resources_table.jsp.column.id"/>
        <fmt:message var="col_name" key="view_resources_table.jsp.column.name"/>
        <fmt:message var="col_description" key="view_resources_table.jsp.column.description"/>
        <fmt:message var="col_actions" key="view_resources_table.jsp.column.actions"/>
        <fmt:message var="col_path" key="view_resources_table.jsp.column.path"/>

        <jsecurity:hasPermission name="blog:addResource:${actionBean.blogEntry.blog.id}">
        <stripes:link id="add" beanclass="foo.bar.blog.web.action.registered.BlogsProfileActionBean" event="addResource">
            <stripes:param name="blogEntry" value="${actionBean.blogEntry.id}"/>
            <fmt:message key="view_resources_table.jsp.action.add"/>
        </stripes:link>
        <br/>
        </jsecurity:hasPermission>

        <displaytag:table id="element" name="actionBean.resources.list" sort="external"
                          excludedParams="*"
                          defaultsort="1"
                          defaultorder="ascending"
                          style="width:100%;"
                          requestURI="tableUrl"
                          requestURIcontext="true" >
            <displaytag_el:column property="id" sortable="false" sortName="id" title="${col_id}"  />
            <displaytag_el:column property="name" sortable="false" sortName="name" title="${col_name}" />
            <displaytag_el:column property="description" sortable="false" sortName="description" title="${col_description}" />
            <displaytag_el:column title="${col_path}">
                The resource is accessible through either
                <ul>
                    <li>url: /Resource.action?resource=${element.id}</li>
                    <li>wiki syntax: {#${element.name}}</li>
                </ul>

            </displaytag_el:column>
            <displaytag_el:column title="${col_actions}">
                <jsecurity:hasPermission name="blog:editResource:${actionBean.blogEntry.blog.id}">
                <stripes:link beanclass="foo.bar.blog.web.action.registered.BlogsProfileActionBean" event="editResource">
                    <stripes:param name="resource" value="${element.id}"/>
                    <stripes:param name="blogEntry" value="${element.entry.id}"/>
                    <fmt:message key="view_resources_table.jsp.action.edit"/>
                </stripes:link>
                </jsecurity:hasPermission>
                <jsecurity:hasPermission name="blog:deleteResource:${actionBean.blogEntry.blog.id}">
                |&nbsp;<stripes:link beanclass="foo.bar.blog.web.action.registered.BlogsProfileActionBean" event="deleteResource">
                    <stripes:param name="resource" value="${element.id}"/>
                    <stripes:param name="blogEntry" value="${element.entry.id}"/>
                    <fmt:message key="view_resources_table.jsp.action.remove"/>
                </stripes:link>
                </jsecurity:hasPermission>
            </displaytag_el:column>
        </displaytag:table>
</jsecurity:hasPermission>

